package com.hou.shopping.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.hou.shopping.valid.AddGroup;
import com.hou.shopping.valid.ListValue;
import com.hou.shopping.valid.UpdateGroup;
import com.hou.shopping.valid.UpdateStatusGroup;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * Ʒ��
 * 
 * @author hxj
 * @email houxiaojie1256@163.com
 * @date 2024-12-09 19:32:47
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * Ʒ��id
	 */
	@TableId
	@NotNull(message ="修改必须指定品牌ID",groups ={UpdateGroup.class} )
	@Null(message = "新增不能指定品牌ID",groups = {AddGroup.class})
	private Long brandId;
	/**
	 * Ʒ����
	 */
	@NotBlank(message = "品牌名不能为空",groups = {AddGroup.class, UpdateGroup.class})
	private String name;
	/**
	 * Ʒ��logo��ַ
	 */
	@URL(message = "logo必须是一个合法的URL地址",groups = {AddGroup.class, UpdateGroup.class})
	@NotEmpty(groups = {AddGroup.class})
	private String logo;
	/**
	 * ����
	 */
	private String descript;
	/**
	 * ��ʾ״̬[0-����ʾ��1-��ʾ]
	 */
	@NotNull(groups = {AddGroup.class, UpdateStatusGroup.class})
	@ListValue(vals={0,1},groups = {AddGroup.class, UpdateStatusGroup.class},message = "状态只能是0/1")
	private Integer showStatus;
	/**
	 * ��������ĸ
	 */
	@NotEmpty(groups = {AddGroup.class})   //新增的时校验非空
	@Pattern(regexp = "^[a-zA-Z]$",message = "检索首字母必须是一个字母",groups = {AddGroup.class, UpdateGroup.class})
	private String firstLetter;
	/**
	 * ����
	 */
	@NotNull(groups = {AddGroup.class})
	@Min(value = 0,message = "排序必须大于等于0")
	private Integer sort;

}
